package edu.nf.ch05.web;

import edu.nf.ch05.common.resultvo.ResultVO;
import edu.nf.ch05.service.DeckillService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author gjh
 * @Date 2025/9/29
 * @Description:
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1")
public class DeckillController {

    private final DeckillService deckillService;

    @PostMapping("/decrStock/{id}")
    public ResultVO<String> decrStock(@PathVariable int id){
        deckillService.decrStock(id);
        return ResultVO.success();
    }
}
